export const satelliteSchedulingCss = `
.satellite-scheduling {
  width: 100%;
  height: 100%;
  background: white;
  display: flex;
  flex-direction: column;
}

.scheduling-header {
  padding: 16px 24px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.scheduling-header h2 {
  margin: 0;
  font-size: 20px;
  color: #333;
}

.query-device-btn {
  margin-left: 16px;
  font-size: 14px;
  padding: 8px 16px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* 日期选择器样式 */
.date-picker-section {
  display: flex;
  align-items: center;
}

.date-picker-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  background: white;
}

.date-input {
  border: none;
  outline: none;
  font-size: 14px;
  color: #333;
  background: transparent;
  cursor: pointer;
}

.day-counter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.counter-btn {
  width: 24px;
  height: 24px;
  border: 1px solid #ddd;
  background: white;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #666;
  transition: all 0.2s;
}

.counter-btn:hover {
  background: #f8f9fa;
  border-color: #007bff;
  color: #007bff;
}

.day-display {
  min-width: 30px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.day-input {
  min-width: 50px;
  width: 50px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 4px;
  background: white;
}

.day-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.btn-primary {
  background: #007bff;
  color: white;
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #1e7e34;
}

.btn-info {
  background: #17a2b8;
  color: white;
}

.btn-info:hover {
  background: #138496;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #545b62;
}

.btn-warning {
  background: #ffc107;
  color: #212529;
}

.btn-warning:hover {
  background: #e0a800;
}

.scheduling-content {
  flex: 1;
  overflow: auto;
  position: relative;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #666;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.empty-text {
  font-size: 16px;
  margin-bottom: 24px;
}

/* 表格样式 */
.schedule-table {
  width: 100%;
  height: 100%;
  overflow: auto;
  position: relative; /* 为框选区域提供定位参考 */
  user-select: none; /* 防止文本选择干扰框选 */
  /* 确保sticky定位正常工作 */
  contain: layout style;
}

/* 框选区域样式 */
.selection-box {
  position: absolute;
  border: 2px dashed #007bff;
  background-color: rgba(0, 123, 255, 0.1);
  pointer-events: none;
  z-index: 1000;
  border-radius: 3px;
  animation: pulse-border 0.8s ease-in-out infinite alternate;
}

@keyframes pulse-border {
  from {
    border-color: #007bff;
  }
  to {
    border-color: #0056b3;
  }
}

.scheduling-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  position: relative; /* 确保sticky定位的参考点 */
}

.scheduling-table th,
.scheduling-table td {
  border-left: 1px solid #e9ecef;
  border-right: 1px solid #e9ecef;
  border-top: none;
  border-bottom: none;
  text-align: center;
  vertical-align: top;
  width: 100px;
  min-width: 100px;
  max-width: 100px;
}



.satellite-header {
  background: #f8f9fa;
  font-weight: bold;
  padding: 10px 8px;
  min-width: 80px;
  white-space: nowrap;
}

/* 时间列样式 */
.time-header {
  background: #e9ecef !important; /* 使用!important提高优先级 */
  font-weight: bold;
  padding: 10px 8px;
  min-width: 80px;
  width: 80px;
  max-width: 80px;
  white-space: nowrap;
  position: sticky;
  left: 0;
  z-index: 999; /* 进一步大幅提高z-index确保在最上层 */
  border-right: 2px solid #dee2e6;
}

.time-cell {
  background: #f8f9fa !important; /* 使用!important提高优先级 */
  padding: 1px 2px;
  min-width: 80px;
  width: 80px;
  max-width: 80px;
  height: 12px;
  border-right: 2px solid #dee2e6;
  border-bottom: 1px solid #e9ecef;
  position: sticky;
  left: 0;
  z-index: 998; /* 进一步大幅提高z-index确保在任务块上方 */
  vertical-align: middle;
  text-align: center;
}

.time-display {
  font-size: 8px;
  color: #666;
  font-weight: 500;
  text-align: center;
  line-height: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.schedule-row {
  height: 12px;
  min-height: 12px;
  border-bottom: 1px solid #e9ecef;
}

.schedule-cell {
  padding: 0;
  height: 12px;
  min-height: 12px;
  cursor: pointer;
  transition: background-color 0.2s;
  vertical-align: top;
  position: relative;
  overflow: visible;
  border-bottom: 1px solid #e9ecef;
}

.schedule-cell:hover {
  background-color: #f8f9fa;
}



.schedule-content {
  position: relative;
  min-height: 12px;
  height: 100%;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.schedule-item {
  border-radius: 0;
  padding: 0 1px;
  margin: 0;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: 0.5px solid #666666; /* 左边框 */
  border-right: 0.5px solid #666666; /* 右边框 */
  border-top: 0.5px solid #666666; /* 顶部边框 */
  border-bottom: none; /* 默认无底部边框 */
  outline: none; /* 移除拖拽时的黑色边框 */
}

/* 为schedule-content中的第一个任务块确保有顶部边框 */
.schedule-content .schedule-item:first-child {
  border-top: 0.5px solid #666666;
}

/* 为schedule-content中的最后一个任务块添加底部边框 */
.schedule-content .schedule-item:last-child {
  border-bottom: 0.5px solid #666666;
}

/* 当只有一个任务块时，确保四周都有边框 */
.schedule-content .schedule-item:only-child {
  border: 0.5px solid #666666;
}

/* 针对1天任务块的特殊样式 */
.schedule-item[style*="height: 13px"] {
  line-height: 13px;
}

.schedule-item[style*="height: 13px"] .schedule-item-content {
  line-height: 13px;
}

.schedule-item[style*="height: 13px"] .schedule-item-title {
  line-height: 13px;
  margin: 0;
  padding: 0;
}

/* 更精确的1天任务块样式 */
.schedule-item.single-day {
  line-height: 13px;
}

.schedule-item.single-day .schedule-item-content {
  line-height: 13px;
  height: 13px;
  min-height: 13px;
}

.schedule-item.single-day .schedule-item-title {
  line-height: 13px;
  height: 13px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.schedule-item-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  align-items: center;
  text-align: center;
  flex: 1;
}

.schedule-item-title {
  font-weight: bold;
  margin: 0;
  font-size: 10px;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  text-align: center;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.schedule-item-duration {
  font-size: 7px;
  opacity: 0.8;
  white-space: nowrap;
}

.schedule-item.selected {
  border: 2px solid #1e3a8a !important;
  z-index: 100 !important;
  position: relative;
}

/* 任务块样式 */
.schedule-item {
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.3);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  outline: none; /* 移除拖拽时的黑色边框 */
}

.schedule-item-content {
  text-align: center;
  width: 100%;
  z-index: 2;
  position: relative;
}

.schedule-item-title {
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* 有冲突的任务块样式 */
.schedule-item.has-conflict {
  border-color: #dc3545;
  box-shadow: 0 0 4px rgba(220, 53, 69, 0.5);
}

/* 冲突覆盖层样式 */
.conflict-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}



/* 保持原有的整体冲突样式作为备用 */
.schedule-item.conflict {
  background-color: #dc3545 !important; /* 强制使用红色背景 */
  border-color: #a71e2a !important; /* 深红色边框 */
  box-shadow: 0 0 8px rgba(220, 53, 69, 0.5) !important; /* 红色阴影 */
}

.schedule-item.conflict:hover {
  background-color: #c82333 !important; /* 悬停时使用更深的红色 */
  transform: scale(1.02);
  box-shadow: 0 0 12px rgba(220, 53, 69, 0.7) !important;
}

.schedule-item:hover {
  opacity: 0.9;
  transform: scale(1.02);
  transition: all 0.2s ease;
}

/* 拖拽相关样式 */
.schedule-item[draggable="true"] {
  cursor: grab;
}

.schedule-item[draggable="true"]:active {
  cursor: grabbing;
}

/* 拖拽时的样式 */
.schedule-item.dragging {
  opacity: 0.5;
  transform: rotate(5deg);
  z-index: 1000;
}

/* 拖拽目标区域样式 */
/* .drag-over-allowed {
  background-color: rgba(0, 123, 255, 0.1) !important;
  border: 2px dashed #007bff !important;
}

.drag-over-denied {
  background-color: rgba(220, 53, 69, 0.1) !important;
  border: 2px dashed #dc3545 !important;
}

.drag-over-auto-arrange {
  background-color: rgba(255, 193, 7, 0.1) !important;
  border: 2px dashed #ffc107 !important;
} */



.schedule-grid {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden; /* 确保只有表格容器滚动 */
}

.timeline-header {
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
}

.timeline-dates {
  display: flex;
}



.time-slots {
  display: flex;
  height: 24px;
}

.time-slot {
  flex: 1;
  border-right: 1px solid #f0f0f0;
  min-width: 5px;
}

.satellite-rows {
  flex: 1;
}

.satellite-row {
  display: flex;
  min-height: 44px;
}

.satellite-label {
  width: 120px;
  padding: 16px 12px;
  background: #f8f9fa;
  border-right: 1px solid #e9ecef;
  display: flex;
  align-items: center;
  position: sticky;
  left: 0;
  z-index: 5;
}

.satellite-name {
  font-weight: 500;
  color: #333;
}

.schedule-timeline {
  flex: 1;
  display: flex;
}



.time-grid {
  display: flex;
  height: 100%;
}

.time-grid .time-cell {
  flex: 1;
  border-right: 1px solid #f0f0f0;
  cursor: pointer;
  position: relative;
  min-height: 44px;
  transition: background-color 0.2s;
}

.time-grid .time-cell:hover {
  background: #f8f9fa;
}

.schedule-item {
  background: #007bff;
  color: white;
  padding: 4px 6px;
  border-radius: 0;
  font-size: 11px;
  text-align: center;
  margin: 0;
  width: 100%;
  max-width: 100%;
  height: 40px;
  min-height: 40px;
  white-space: normal;
  overflow: hidden;
  cursor: grab;
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  outline: none; /* 移除拖拽时的黑色边框 */
}

.schedule-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.schedule-item:active {
  cursor: grabbing;
}

.schedule-item[draggable="true"]:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.schedule-item.task {
  background: #28a745;
}

.schedule-item.maintenance {
  background: #ffc107;
  color: #212529;
}

.schedule-item.test {
  background: #17a2b8;
}

.schedule-item.downtime {
  background: #dc3545;
}

.schedule-item.selected {
  border: 3px solid #1e3a8a !important;
  z-index: 100 !important;
  position: relative;
}

.schedule-item.selected:hover {
  border: 3px solid #1e40af !important;
}

.schedule-item-title {
  font-weight: 500;
  margin-bottom: 2px;
}

.schedule-item-details {
  font-size: 10px;
  opacity: 0.9;
  line-height: 1.2;
}

.schedule-item-duration {
  margin-bottom: 1px;
}

.schedule-item-device {
  font-style: italic;
}
/* 模板配置弹窗样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.template-modal {
  background: white;
  border-radius: 8px;
  width: 600px;
  max-width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eee;
  background-color: #f8f9fa;
}

.modal-header h3 {
  margin: 0;
  color: #333;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: #333;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.add-template-section {
  margin-bottom: 20px;
}

.add-template-btn {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.add-template-btn:hover {
  background-color: #218838;
}

.template-table {
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.table-header {
  display: grid;
  grid-template-columns: 1fr 200px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #ddd;
}

.header-cell {
  padding: 12px 16px;
  font-weight: bold;
  text-align: center;
  border-right: 1px solid #ddd;
  font-size: 14px;
}

.header-cell:last-child {
  border-right: none;
}

.template-row {
  display: grid;
  grid-template-columns: 1fr 200px;
  border-bottom: 1px solid #eee;
}

.template-row:last-child {
  border-bottom: none;
}

.cell {
  padding: 12px 16px;
  border-right: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cell:last-child {
  border-right: none;
}

.template-number {
  font-weight: 500;
  color: #333;
}

.template-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background-color 0.2s;
}

.edit-btn {
  background: #6c757d;
  color: white;
}

.edit-btn:hover {
  background: #545b62;
}

.copy-btn {
  background: #17a2b8;
  color: white;
}

.copy-btn:hover {
  background: #138496;
}

.delete-btn {
  background: #dc3545;
  color: white;
}

.delete-btn:hover {
  background: #c82333;
}

.empty-template {
  padding: 40px 20px;
  text-align: center;
  color: #666;
  font-style: italic;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px;
  border-top: 1px solid #eee;
  background-color: #f8f9fa;
}

.cancel-btn {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
}

.cancel-btn:hover {
  background-color: #545b62;
}

.apply-btn {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
}

.apply-btn:hover:not(:disabled) {
  background-color: #0056b3;
}

.apply-btn:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

.template-item.selected {
  border: 2px solid #007bff;
  background-color: #e3f2fd;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

/* 模板设计界面样式 */
.template-design-modal {
  width: 90%;
  max-width: 1200px;
  height: 90vh; /* 进一步增加弹窗高度从85vh到90vh */
  background: white !important;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column; /* 确保垂直布局 */
}

.template-design-modal .modal-footer {
  background-color: white !important; /* 强制设置为白色背景 */
  border-top: 1px solid #eee;
  padding: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: relative; /* 确保按钮在正确位置 */
  flex-shrink: 0; /* 防止按钮区域被压缩 */
}

.template-design-modal .modal-header {
  background-color: white !important; /* 确保头部也是白色 */
  border-bottom: 1px solid #eee;
}

.draggable-header {
  cursor: move;
  user-select: none;
  outline: none; /* 移除拖拽时的黑色边框 */
}

.draggable-header:active {
  cursor: grabbing;
}

.template-design-body {
  display: flex;
  flex: 1; /* 占用剩余空间 */
  gap: 20px;
  background: white !important;
  padding: 20px;
  overflow: auto; /* 允许内容滚动而不是被截断 */
}

.task-blocks-panel,
.arrangement-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: visible; /* 允许内容完全显示 */
  min-height: 500px; /* 增加最小高度从350px到500px */
  max-height: none; /* 移除最大高度限制，让其自适应 */
}

.panel-header {
  background: #f8f9fa;
  padding: 12px 16px;
  border-bottom: 1px solid #ddd;
}

.panel-header h4 {
  margin: 0;
  font-size: 16px;
  color: #333;
}

.task-blocks-list {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-content: start;
  min-height: 450px; /* 增加任务块列表的最小高度从300px到450px */
}

.task-block-item {
  padding: 12px 16px;
  border-radius: 6px;
  color: white;
  cursor: grab;
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
}

.task-block-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.task-block-item:active {
  cursor: grabbing;
}

.task-block-name {
  font-weight: 500;
  margin-bottom: 4px;
}

.task-block-duration {
  font-size: 12px;
  opacity: 0.9;
}

.task-block-device {
  font-size: 11px;
  opacity: 0.8;
  margin-top: 2px;
}

.empty-task-blocks {
  text-align: center;
  color: #666;
  font-style: italic;
  padding: 40px 20px;
}

.arrangement-area {
  flex: 1;
  padding: 16px;
  min-height: 450px; /* 增加排列区的最小高度从300px到450px */
  max-height: none; /* 移除最大高度限制 */
  overflow-y: auto;
  background: white;
  border: 2px dashed #ddd;
  border-radius: 6px;
  margin: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px; /* 减少任务块之间的间距 */
  transition: border-color 0.2s, background-color 0.2s;
  scroll-behavior: smooth; /* 平滑滚动 */
}

.arrangement-area.drag-over {
  border-color: #007bff;
  background-color: #f0f8ff;
}

.arranged-task-block {
  padding: 12px 16px;
  border-radius: 6px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  transition: transform 0.2s, opacity 0.2s;
  cursor: grab;
  outline: none; /* 移除拖拽时的黑色边框 */
}

.arranged-task-block:active {
  cursor: grabbing;
}

.arranged-task-block[draggable="true"]:hover {
  transform: translateX(4px) scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.arranged-task-block:hover {
  transform: translateX(4px);
}

.task-block-content {
  flex: 1;
}

.remove-task-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background-color 0.2s;
}

.remove-task-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.empty-arrangement {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drop-hint {
  color: #999;
  font-size: 16px;
  text-align: center;
  padding: 40px;
  border: 2px dashed #ccc;
  border-radius: 8px;
  background: #f8f9fa;
  width: 100%;
}

.save-btn {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
}

.save-btn:hover {
  background-color: #0056b3;
}

/* 可点击表头样式 */
.clickable-header {
  cursor: pointer;
  transition: background-color 0.2s;
}

.clickable-header:hover {
  background-color: #e9ecef !important;
}

/* 模板选择弹窗样式 */
.template-selector-modal {
  background: white;
  border-radius: 8px;
  width: 800px;
  max-width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.template-selector-body {
  flex: 1;
  overflow: hidden;
  padding: 20px;
}

.template-selector-content {
  height: 100%;
}

.template-list-section {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.template-list-section h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 16px;
}

.template-list {
  flex: 1;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 15px;
  background: #f8f9fa;
  overflow-y: auto;
  max-height: 300px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-content: start;
}

.template-item {
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 0;
  transition: box-shadow 0.2s;
  min-height: 60px;
}

.template-item:hover {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.template-item:last-child {
  margin-bottom: 0;
}

.template-name {
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
}

.template-description {
  color: #666;
  font-size: 14px;
}

.empty-templates {
  text-align: center;
  color: #999;
  padding: 40px 20px;
  font-style: italic;
}



.clickable-template {
  cursor: pointer;
  transition: all 0.3s;
}

.clickable-template:hover {
  background: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.task-block-item {
  position: relative;
  min-height: 80px;
  padding: 16px 12px;
}

.task-block-color {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.template-blocks {
  font-size: 12px;
  color: #7f8c8d;
  margin-top: 5px;
}

/* 复制其他星弹窗样式 */
.copy-satellite-dialog {
  background: white;
  border-radius: 12px;
  width: 600px;
  max-width: 90%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.dialog-header {
  padding: 20px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
}

.dialog-header h3 {
  margin: 0;
  color: #333;
  font-size: 18px;
}

.dialog-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.target-info {
  background: #e3f2fd;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.target-info p {
  margin: 5px 0;
  color: #1976d2;
}

.copy-mode-section {
  margin-bottom: 25px;
}

.copy-mode-section h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 16px;
}

.mode-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-option:hover {
  border-color: #2196f3;
  background: #f8f9fa;
}

.mode-option input[type="radio"] {
  margin: 0;
  margin-top: 2px;
}

.mode-option span {
  font-weight: 500;
  color: #333;
  display: block;
  margin-bottom: 4px;
}

.mode-option small {
  color: #666;
  font-size: 12px;
  line-height: 1.4;
}

.source-selection h4 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 16px;
}

.satellite-list {
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background: #f8f9fa;
}

.satellite-item {
  background: white;
  border-bottom: 1px solid #e9ecef;
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.satellite-item:last-child {
  border-bottom: none;
}

.satellite-item:hover {
  background: #f0f8ff;
}

.satellite-item.selected {
  background: #e3f2fd;
  border-color: #2196f3;
  box-shadow: inset 0 0 0 2px #2196f3;
}

.satellite-info {
  flex: 1;
}

.satellite-name {
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
  font-size: 14px;
}

.satellite-task-count {
  color: #666;
  font-size: 12px;
}

.empty-satellites {
  padding: 30px;
  text-align: center;
  color: #999;
  font-style: italic;
}

.dialog-footer {
  padding: 20px;
  border-top: 1px solid #e9ecef;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #f8f9fa;
}

.cancel-btn {
  padding: 10px 20px;
  border: 1px solid #ccc;
  background: white;
  color: #666;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.cancel-btn:hover {
  background: #f8f9fa;
  border-color: #999;
}

.confirm-btn {
  padding: 10px 20px;
  border: none;
  background: #28a745;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.confirm-btn:hover:not(:disabled) {
  background: #218838;
}

.confirm-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.copy-btn {
  background-color: #28a745;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.copy-btn:hover {
  background-color: #218838;
}

.copy-btn:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

/* 右键上下文菜单样式 */
.context-menu {
  position: fixed;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  min-width: 120px;
  padding: 4px 0;
}

.context-menu-item {
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 14px;
  color: #333;
}

.context-menu-item:hover {
  background-color: #f5f5f5;
}

.context-menu-item:active {
  background-color: #e9ecef;
}

/* 编辑弹窗样式 */
.edit-item-modal {
  width: 600px;
  max-height: 80vh;
  background-color: white;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.edit-item-modal .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.edit-item-modal .modal-footer {
  flex-shrink: 0;
  background-color: white;
  border-top: 1px solid #e9ecef;
  padding: 20px;
  margin-top: 0;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background-color: white;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-select[multiple] {
  height: 120px;
  padding: 8px;
}

.form-hint {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: #666;
  font-style: italic;
}

.day-configs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.day-configs-header .button-group {
  display: flex;
  gap: 4px;
}

.day-configs-header label {
  margin-bottom: 0;
}

.activate-all-btn {
  padding: 6px 16px;
  background-color: #17a2b8;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-weight: 500;
}

.activate-all-btn:hover:not(:disabled) {
  background-color: #138496;
}

.activate-all-btn:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

.clear-all-btn {
  padding: 6px 16px;
  background-color: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-weight: 500;
}

.clear-all-btn:hover {
  background-color: #c82333;
}

.day-configs {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 10px;
  background-color: white;
}

.day-config-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
  gap: 15px;
}

.day-config-row:last-child {
  margin-bottom: 0;
}

.day-label {
  min-width: 60px;
  font-size: 14px;
  color: #666;
  font-weight: 500;
  margin-top: 8px;
}

.day-device-control {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.active-devices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 32px;
  padding: 8px;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  background-color: #f8f9fa;
}

.no-devices {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 8px;
  border: 1px dashed #ccc;
  border-radius: 4px;
  background-color: #fafafa;
  color: #999;
  font-style: italic;
  font-size: 13px;
}

.device-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background-color: #007bff;
  color: white;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.activate-btn {
  align-self: flex-start;
  padding: 6px 12px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.activate-btn:hover:not(:disabled) {
  background-color: #218838;
}

.activate-btn:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
  opacity: 0.6;
}

/* 已移除未使用的 .day-select 样式 */

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
  margin-top: 20px;
}

.cancel-btn {
  padding: 10px 20px;
  border: 1px solid #ddd;
  background-color: white;
  color: #666;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.cancel-btn:hover {
  background-color: #f8f9fa;
  border-color: #adb5bd;
}

.save-btn {
  padding: 10px 20px;
  border: none;
  background-color: #007bff;
  color: white;
  border-radius: 4px;
  cursor: pointer;
}

.save-btn:hover {
  background-color: #0056b3;
}

/* 设备选择器样式 */
.device-selector {
  position: relative;
  width: 100%;
}

.selected-devices-display {
  min-height: 40px;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px;
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.2s;
}

.selected-devices-display:hover {
  border-color: #007bff;
}

.placeholder-text {
  color: #999;
  font-size: 14px;
}

.selected-devices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.device-tag {
  display: inline-flex;
  align-items: center;
  background-color: #007bff;
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  gap: 4px;
}

.remove-device {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.remove-device:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.dropdown-toggle {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
  transition: transform 0.2s;
}

.dropdown-toggle:hover {
  color: #007bff;
}

.device-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.device-group {
  border-bottom: 1px solid #f0f0f0;
}

.device-group:last-child {
  border-bottom: none;
}

.group-title {
  padding: 8px 12px;
  background-color: #f8f9fa;
  font-weight: 500;
  font-size: 13px;
  color: #666;
  border-bottom: 1px solid #e9ecef;
}

.device-option {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  transition: background-color 0.2s;
}

.device-option:hover {
  background-color: #f8f9fa;
}

.device-option input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.device-option span {
  flex: 1;
}

/* 去重：移除早期重复的任务块选择器样式（保留后续更完整的版本） */

/* 任务块选择器弹窗样式 */
.task-block-selector-modal {
  background: white;
  border-radius: 8px;
  width: 800px;
  max-width: 95%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.task-block-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  background: #f8f9fa;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 10px;
}

.task-block-list .task-block-item {
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 80px;
  justify-content: center;
}

.task-block-list .task-block-item:hover {
  border-color: #007bff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.task-block-list .task-block-item.selected {
  border-color: #007bff;
  background-color: #f8f9ff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.task-block-list .task-block-item:last-child {
  border-bottom: none;
}

.empty-task-blocks {
  text-align: center;
  padding: 40px;
  color: #999;
  font-style: italic;
}

/* 设备容量配置样式 */
.device-capacity-config {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px;
  background-color: #f9f9f9;
}

.capacity-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
}

.capacity-item:last-child {
  margin-bottom: 0;
}

.device-label {
  min-width: 100px;
  font-weight: 500;
  color: #333;
}

.capacity-input {
  width: 80px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  text-align: center;
  font-size: 14px;
}

.capacity-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.capacity-unit {
  color: #666;
  font-size: 14px;
}

/* 响应式设计 - 任务块选择器 */
@media (max-width: 1024px) {
  .task-block-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .task-block-selector-modal {
    width: 95%;
    max-width: none;
  }
  
  .task-block-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
  }
  
  .task-block-list .task-block-item {
    padding: 8px;
    min-height: 70px;
  }
  
  .task-block-name {
    font-size: 12px;
  }
  
  .task-block-info {
    font-size: 10px;
  }
}

@media (max-width: 480px) {
  .task-block-list {
    grid-template-columns: 1fr;
  }
  
  .task-block-list .task-block-item {
    min-height: 60px;
  }
}
/* 高亮样式 */
.highlighted-column {
  background-color: rgba(0, 123, 255, 0.1) !important;
  border-left: 2px solid #007bff !important;
  border-right: 2px solid #007bff !important;
}

.highlighted-row {
  background-color: rgba(0, 123, 255, 0.08) !important;
  border-top: 1px solid #007bff !important;
  border-bottom: 1px solid #007bff !important;
}

.highlighted-cell {
  background-color: rgba(0, 123, 255, 0.15) !important;
  border: 2px solid #007bff !important;
}

/* 表头高亮样式 */
.satellite-header.highlighted-column {
  background-color: rgba(0, 123, 255, 0.2) !important;
  color: #0056b3 !important;
  font-weight: bold !important;
}

/* 时间单元格高亮样式 */
.time-cell.highlighted-row {
  background-color: rgba(0, 123, 255, 0.1) !important;
  color: #0056b3 !important;
  font-weight: bold !important;
}

/* 确保高亮样式优先级 */
.schedule-cell.highlighted-column,
.schedule-cell.highlighted-row,
.schedule-cell.highlighted-cell {
  position: relative;
}

/* 高亮时的过渡效果 */
.satellite-header,
.schedule-row,
.schedule-cell {
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
`

const STYLE_TAG_ID = 'satellite-scheduling-styles'

export function injectSatelliteSchedulingStyles() {
  if (typeof document === 'undefined') return
  if (document.getElementById(STYLE_TAG_ID)) return
  const style = document.createElement('style')
  style.id = STYLE_TAG_ID
  style.type = 'text/css'
  style.appendChild(document.createTextNode(satelliteSchedulingCss))
  document.head.appendChild(style)
}